package de.unistuttgart.iaas.interaction.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
 
/**
 * This class creates an authenication object.
 * @author Lina Sun
 */
@SuppressWarnings("restriction")
public class MailAuthenticator extends Authenticator{
	 private String user;
	 private String password;
	 
	/**
	 * MailAuthenticatior constructor
	 * @param user
	 * @param password
	 */
	public MailAuthenticator(String user, String password)
	{
	    this.user = user;
	    this.password = password;
	 }
	 
	    /**
	     * This method can be automated called, if the user and password will be asked.
	     */
	    public PasswordAuthentication getPasswordAuthentication()
	    {
	        return new PasswordAuthentication(user, password);
	    }

}
